/* **********************************************************
 * Copyright 2010 Dimitar Vangelovski
 *
 * This file is part of the Gens3 3D Engine.
 * 
 * The Gens3 3D Engine is free software; you can redistribute it and/or
 * modify it under the terms of version 2 of the GNU General Public
 * License as published by the Free Software Foundation.
 * 
 * The Gens3 3D Engine is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with the Gens3 3D Engine; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301, USA
 * **********************************************************/

#pragma once

#include "Vertex.h"
#include <vector>
#include <string>

class CAnimObject
{
public:
	enum eObjectType
	{
		eUnknown = -1,
		eGeomObject,
		eLightObject,
	};

public:
	CAnimObject();
	CAnimObject(const CAnimObject &other);
	~CAnimObject();

	void			SetVertexList(std::vector<CVertex> other) { m_VertexList = other; }
	void			SetObjectType(int iType) { m_iObjectType = iType; }
	void			SetSceneObjIndex(int iIndex) { m_iSceneObjIndex = iIndex; }
	
	void			InsertVertex(CVertex other) { m_VertexList.push_back(other); }

	std::vector<CVertex>	GetVertexList() const { return m_VertexList; }
	int                     GetObjectType() const { return m_iObjectType; }
	int                     GetSceneObjIndex() const { return m_iSceneObjIndex; }

	std::vector<CVertex>	Animate(float fSpeed);

private:
	std::vector<CVertex>	m_VertexList;
	int                     m_iObjectType;
	int                     m_iSceneObjIndex;	// the index where this object is in the scene
	float                   cax, cay, caz;		// current rotation (animation) angles
	float                   ctx, cty, ctz;		// current translation (animation) vector
	float                   m_fSta;             // angle for the sinus translation animation in degrees

public:
	std::string     m_strRotCenter;		// rotation center name
	CVertex         m_RotCenter;		// rotation center cordinates
	float           ax, ay, az;         // rotation angles in degrees (the animation angle - speed, by which the object is animated)

public:
	float		tx, ty, tz;		// translation vector
	float		m_fTrSpeed;		// translation (animation) speed
	float		m_fTrRange;		// translation range in pixels (defines how much the object moves (+-) from the current position)
};
